﻿using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Forms;
using System.Text;

namespace HR60_PanelSoft.View
{
	public class ViewUtils
	{
		// 提示信息
		public static void showMessage(string msg)
		{
			MessageBox.Show(msg, "提示");
		}
		
		// 警告信息
		public static void showAlert(string msg)
		{
			MessageBox.Show(msg, "警告");
		}

		// 错误信息
		public static void showError(string msg)
		{
			MessageBox.Show(msg, "错误提醒");
		}

		// 打开文件窗体
		public static string showOpenFileDialog()
		{
			OpenFileDialog ofd = new OpenFileDialog();
			ofd.Multiselect = false;
			ofd.Filter = "JSON文件|*.json";
			DialogResult dr = ofd.ShowDialog();
			if (dr == DialogResult.OK)
			{
				return ofd.FileName;
			}
			return null;
		}

		// 保存文件窗体
		public static string showSaveFileDialog()
		{
			SaveFileDialog sfd = new SaveFileDialog();
			sfd.Filter = "JSON文件|*.json";
			DialogResult dr = sfd.ShowDialog();
			if (dr == DialogResult.OK)
			{
				return sfd.FileName;
			}
			return null;
		}
	}
}
